The script in frame 2 is responsible for setting the initial starting coordinates for the individual vertices.
3D objects are made up of vertices that are basically reference points in 3D space. In a 3D environment, vertices have a Z co-ordinate as well as X and Y. The figure shows the vertex co-ordinates for a two-dimensional square of 100 units high and wide, with its center point at co-ordinate 0,0. Its co-ordinates consists of:
Point 1: x=-50, y=-50
Point 2: x=50, y=-50
Point 3: x=-50, y=50
Point 4: x=50, y=50
To extrude this square into a cube, each vertex would also need a Z co-ordinate.So, the co-ordinates for a cube with the dimensions of a 100 units high, wide and deep with its centerpoint at co-ordinate at 0,0,0 will look like this:
Point 1: x=-50, y=-50, z=-50
Point 2: x=50, y=-50, z=-50
Point 3: x=-50, y=50, z=-50
Point 4: x=50, y=50, z=-50
Point 5: x=-50, y=-50, z=50
Point 6: x=50, y=-50, z=50
Point 7: x=-50, y=50, z=50
Point 8: x=50, y=50, z=50
For our purpose, these co-ordinates can be stored by using an array of variables (Variables: "x", "y" and "z") that would later be used to do the 3D calculation.You can do this manually by setting the value for variables "x", "y" and "z" individually.
Alternatively, you can write a looping script to do this. In this specific example, when the movie begins, I wanted all the points to line up in a line along the X-axis to spell out the name W-I-R-E-F-R-A-M-E. I wanted the first point (W) to be set at coordinate ΓÇö80,0,0 (XYZ) and the last one at coordinate 80,0,0.
I did this simply by running the following script, which uses ΓÇö80 as a starting point and increments the next pointΓÇÖs X-coordinate by 20, until point 9 is set at 80, while the Y and Z coordinates are set to 0.
You can use script to create other geometric forms. For instance, for a spiral that twists around the X-axis, you can use the Sine and Cosine values that were set on the first frame.